import { requestGoodsList } from "../../api/index";

const state = {
  goodsList: [],
  trademarkList: [],
  attrsList: [],
  total: 0,
};
const getters = {};
const actions = {
  async reqGoodsList({ commit }, data) {
    console.log(data);
    let res = await requestGoodsList(data);
    commit("REQGOODSLIST", res);
    // console.log(res);
  },
};
const mutations = {
  REQGOODSLIST(state, res) {
    state.goodsList = res.goodsList;
    state.trademarkList = res.trademarkList;
    state.attrsList = res.attrsList;
    state.total = res.total;
  },
};

export default {
  namespaced: true,
  state,
  getters,
  actions,
  mutations,
};
